import request from '@/utils/request'
import request1 from "../../utils/request1";

// 查询投保用户列表listIdCardType
export function listUser(query) {
  return request({
    url: '/insurance/user/list',
    method: 'get',
    params: query
  })
}
export function listUser1(query) {
  return request1({
    url: '/Insurance/upload_member_list',
    method: 'get',
    params: query
  })
}

// 查询投保用户详细
export function getUser(id) {
  return request({
    url: '/insurance/user/' + id,
    method: 'get'
  })
}
// 查询投保用户详细
export function getUser1(id) {
  return request1({
    url: '/Insurance/edit_user_info?customer_id='+id,
    method: 'get',
    // data:id,
  })
}
// 修改投保用户
export function getUser2(data) {
  return request1({
    url: '/Insurance/edit_user_info',
    method: 'post',
    data:data,
  })
}
//批量新增投保用户
export function batchSave(data){
  return request({
    url: '/insurance/user/batchSave',
    method: 'post',
    data:data,
    // responseType: 'arraybuffer',
    // responseType: "blob",

    // headers:{
    //   // "Content-Type":"application/json;application/vnd.ms-excel"
    // }
  })
}
//批量新增投保用户
export function examines_single(data){
  return request1({
    url: '/Insurance/examines_single',
    method: 'post',
    data:data,

  })
}

// 新增投保用户
export function addUser(data) {
  return request({
    url: '/insurance/user',
    method: 'post',
    data: data
  })
}
// 新增投保用户
export function addUser1(data) {
  return request1({
    url: '/Insurance/upload_user_list',
    method: 'post',
    data: data
  })
}
// 获取二级用户的数据
export function seacond_admin(data) {
  return request1({
    url: '/Insurance/seacond_admin',
    method: 'post',
    data: data
  })
}
// 修改投保用户
export function updateUser(data) {
  return request({
    url: '/insurance/user',
    method: 'put',
    data: data
  })
}

// 删除投保用户
export function delUser(id) {
  ///remove
  return request({
    url: '/insurance/user/remove/?id=' + id,
    method: 'delete',
  })
}
// 删除投保用户
export function delete_user(query) {
  ///remove
  return request1({
    url: '/Insurance/delete_user',
    method: 'post',
    params: query
  })
}
//批量删除
export function delUser1(id) {
  ///remove
  return request({
    url: '/insurance/user/' + id,
    method: 'delete',
  })
}
// 导出投保用户
export function exportUser(query) {
  return request({
    url: '/insurance/user/export',
    method: 'get',
    params: query
  })
}
//投保用户数据模板
export function importTemolate(query){
  return request({
    url: '/insurance/user/importTemplate',
    method: 'get',
    params:query
  })
}
//投保用户数据模板
export function importTemolate1(query){
  return request1({
    url: '/Insurance/get_download_excel_url',
    method: 'get',
    params:query
  })
}
//根据对应投保id查询用户投保信息
export function insureUser(id){
  return request({
    url: '/insurance/user/getInsureUser',
    method: 'get',
    params: id
  })
}
//根据对应投保id查询用户投保信息
export function insureUser1(id){
  return request1({
    url: '/Totalusercount/getInsureUser',
    method: 'get',
    params: id
  })
}
//批单明细管理导出excel导出
export function approveDetailExport(ids,insureId){
  return request({
    url: '/insurance/user/approveDetailExport?ids='+ids+'&insureId='+insureId,
    method: 'get',
    // params: params
  })
}
